// pages/goodsDetail/goodsDetail.js
Page({
    data: {
        categoryList: {
            pageone: [{
                name: "新商家",
                src: "../../images/logo.png"
            }],
            pageTwo: [{
                name: "新商家",
                src: "../../images/logo.png"
            }],
            pageThree: [{
                name: "新商家",
                src: "../../images/logo.png"
            }],
            pageFour: [{
                name: "新商家",
                src: "../../images/logo.png"
            }],
        },
        sortList: [
            "../../images/logo.png",
            "../../images/logo.png",
            "../../images/logo.png"],
        textList: [
            { "label": "乖，摸摸头", "num": "7", "isDack": true },
            { "label": "阿弥陀佛么么哒", "num": "8", "isDack": true },
            { "label": "好吗好的", "num": "3", "isDack": true },
            { "label": "我不", "num": "0", "isDack": false }
        ],
        restaurant: [
            {
                name: "陆小凤",
                sales: "1月5日",
                initial_price: "成都市",
                distribution_price: "狮子",
                distance: "昔日龌龊不足夸，今朝放荡思无涯,春风得意马蹄疾，一夜看尽长安花",
                src: "../../images/logo.png"
            },
            {
                name: "陆小凤",
                sales: "1月5日",
                initial_price: "成都市",
                distribution_price: "狮子",
                distance: "昔日龌龊不足夸，今朝放荡思无涯,春风得意马蹄疾，一夜看尽长安花",
                src: "../../images/logo.png"
            }
        ],
        imagesList: [
            {
                name: "陆小凤",
                src: "../../images/logo.png"
            },
            {
                name: "陆小凤",
                src: "../../images/logo.png"
            },
            {
                name: "陆小凤",
                src: "../../images/logo.png"
            },
            {
                name: "陆小凤",
                src: "../../images/logo.png"
            },
            {
                name: "陆小凤",
                src: "../../images/logo.png"
            }
        ],

        btnList: [
            "../../images/logo.png",
            "../../images/logo.png",
            "../../images/logo.png",
            "../../images/logo.png"],
        isShow: true,

        star: 0,
        starMap: [
            '非常差',
            '差',
            '一般',
            '好',
            '非常好',
        ],

        desc: '附近商家附近商家附近商家附近商家附近商家附近商家',
    },
    onLoad: function (option) {

    },
    buttonSure: function (e) {
        console.log('----f----------');
    },
    onTap: function (option) {
        if (option.currentTarget.dataset.index == 0) {

        } else if (option.currentTarget.dataset.index == 1) {
            // this.showBounced();
        } else if (option.currentTarget.dataset.index == 2) {
            wx.navigateTo({
                url: '../shopping-cart/shopping-cart',
            })
        } else {
            this.setData({
                isShow: !this.data.isShow,
            })
        }
    },
    toPraise: function (option) {
        console.log('2222');
    },
    myStarChoose: function (e) {
        let star = parseInt(e.target.dataset.star) || 0;
        this.setData({
            star: star,
        });
    },
    lookall: function (option) {
        var restaurant = [
            {
                name: "陆小凤",
                sales: "1月5日",
                initial_price: "成都市",
                distribution_price: "狮子",
                distance: "昔日龌龊不足夸，今朝放荡思无涯,春风得意马蹄疾，一夜看尽长安花",
                src: "../../images/logo.png"
            },
            {
                name: "陆小凤",
                sales: "1月5日",
                initial_price: "成都市",
                distribution_price: "狮子",
                distance: "昔日龌龊不足夸，今朝放荡思无涯,春风得意马蹄疾，一夜看尽长安花",
                src: "../../images/logo.png"
            },
            {
                name: "陆小凤",
                sales: "1月5日",
                initial_price: "成都市",
                distribution_price: "狮子",
                distance: "昔日龌龊不足夸，今朝放荡思无涯,春风得意马蹄疾，一夜看尽长安花",
                src: "../../images/logo.png"
            },
            {
                name: "陆小凤",
                sales: "1月5日",
                initial_price: "成都市",
                distribution_price: "狮子",
                distance: "昔日龌龊不足夸，今朝放荡思无涯,春风得意马蹄疾，一夜看尽长安花",
                src: "../../images/logo.png"
            },
            {
                name: "陆小凤",
                sales: "1月5日",
                initial_price: "成都市",
                distribution_price: "狮子",
                distance: "昔日龌龊不足夸，今朝放荡思无涯,春风得意马蹄疾，一夜看尽长安花",
                src: "../../images/logo.png"
            }
        ];
        this.setData({
            restaurant: restaurant,
        })
    },

    formSubmit: function (e) {
        var name = e.detail.value.name;
        var phone = e.detail.value.phone;
        var company = e.detail.value.company;
        var post = e.detail.value.post;
        var params = {
            openId: 'oPFGwwycWjjqLF59gLvN9LG5-m4w',
            agentId: '5a5567547d1ee08c0f3b75f7',
            username: name,
            phone: phone,
            company: company,
            post: post
        }
        app.network.requestPost(app.route.ROUTE_SUB_SCRIBE_MEET, params, '正在加载数据', function (res) {
            //res就是我们请求接口返回的数据
            console.log(res)
        }, function () {
            wx.showToast({
                title: '加载数据失败',
            })
        })
    },
    /**
     * 用户点击右上角分享
     */

})